#include<stdio.h>
#include "func.h"
int main(){
    char choice;
    int a=1,num1,num2;
    opmenu();
    do {        
        printf("Please input your choice:\n");
        scanf("%c",&choice);;
        a=isValidInput(choice);
        if(a==-1) {printf("Error\n");break;}
        switch (choice){
        case '1':{     printf("Please input num1 and num2:\n");
                scanf("%d %d",&num1,&num2);}
                a=add(num1,num2);  
        clearCache();
                break;
        case '2':{     printf("Please input num1 and num2:\n");
                scanf("%d %d",&num1,&num2);
                a=sub(num1,num2);
        clearCache();
                break;}
        case '3':     {printf("Please input num1 and num2:\n");
                scanf("%d %d",&num1,&num2);
                a=mul(num1,num2);
        clearCache();
                break;}
        case '4':     {printf("Please input num1 and num2:\n");
                scanf("%d %d",&num1,&num2);
                a=divide(num1,num2);
        clearCache();
                break;}
        case '5': printf("Please input num1 and num2:\n");
                scanf("%d %d",&num1,&num2);
                a=mod(num1,num2);
        clearCache();
                break;
        case '6': 
                getchar(); cal();
                a=1;break;
        default :return 0;
        }
        opmenu();
    }while(a==1);
return 0;

}
